Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Search facets #103

Merged
merged 12 commits into from
Jun 3, 2024
Merged

feat: Search facets #103

merged 12 commits into from
Jun 3, 2024

Conversation

alexgarel
Copy link
Member

@alexgarel alexgarel commented Apr 24, 2024

  • introduce searchalicious-facets and searchalicious-facet-terms components to:
    • display facets
    • add filters to search
  • refactor base of results handling in the search-results-ctl mixin
  • change API for facets to be more easy to use:
    • add a facets parameter
    • return easier to parse facets results

Limitations:

  • categories_tags seems not to work (but it's a backend problem)
  • we need the API to send back selected value because they may disapear while crossed with full text, so user won't be able to uncheck them ! (but first backend must support it)
  • for now only the "terms" api is supported, and facet is always sorted by count (while it could be sorted by name for nutri-score for example)
facets-demo.mp4

@alexgarel alexgarel changed the base branch from main to some-css April 24, 2024 09:27
Base automatically changed from some-css to main April 24, 2024 09:54
@alexgarel alexgarel marked this pull request as ready for review May 30, 2024 17:44
app/_types.py Outdated Show resolved Hide resolved
app/_types.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@stephanegigandet
Copy link
Contributor

Cool! It would be nice to have a "Apply new filters" button that appears below the facets, as it's not intuitive that we need to click on the search button again to apply them.

- labels_tags
- ecoscore_grade
- nova_groups
- ecoscore_grade
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecoscore_grade is already there, nutriscore maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to remove that, this is not useful any more… now it's the interface that requests facets (more logical).

Co-authored-by: Pierre Slamich <[email protected]>
@alexgarel
Copy link
Member Author

It would be nice to have a "Apply new filters" button that appears below the facets, as it's not intuitive that we need to click on the search button again to apply them.

Yes, in another PR ;-)

Copy link
Collaborator

@Valimp Valimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me

Comment on lines 124 to 126
} else {
return html``; // FIXME: is this ok ?
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this comment highlight ?
If the return html'' render nothing ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was not sure when I code, now it seems ok, I will remove the FIXME :-)

@Valimp
Copy link
Collaborator

Valimp commented May 31, 2024

It would be nice to have a "Apply new filters" button that appears below the facets, as it's not intuitive that we need to click on the search button again to apply them.

Yes, in another PR ;-)

It's possible to updates results when you check any filter

@alexgarel
Copy link
Member Author

alexgarel commented May 31, 2024

It would be nice to have a "Apply new filters" button that appears below the facets, as it's not intuitive that we need to click on the search button again to apply them.

Yes, in another PR ;-)

It's possible to updates results when you check any filter

I personally don't like it much because it makes it hard to select two filters at once…

@alexgarel alexgarel merged commit 4bbada5 into main Jun 3, 2024
6 checks passed
@alexgarel alexgarel deleted the search-facets branch June 3, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants